import { useRoutes, Route, Routes, Navigate } from "react-router-dom";
import "./App.css";
import { newRoutes } from "@/router";
import BasicLayout from "@/layouts/basicLayout";
import AuthorityRoute from "./components/AuthorityRoute";
import { Suspense, useState } from "react";

function App(props) {
  const routes = newRoutes;

  return (
    <Suspense fallback={<h2>Loading..</h2>}>
      <BasicLayout>
        {/* <Routes>{mapRoute(routes)}</Routes> */}
        <AuthorityRoute props={routes} />
      </BasicLayout>
    </Suspense>
  );
}

export default App;
